Problem Note 40639: $VARYING informat produces blank value when the length-variable is zero
The $VARYING informat requires a length-variable that specifies the length of the variable value being read. When the length-variable is zero, the variable stores a blank value.
This is different from what the SAS® 9.2 documentation states. It states that if the value of the length-variable is zero, negative, or missing, SAS reads no data from the corresponding record.
The documentation will be changed in a future release.
Operating System and Release Information
SAS System | Base SAS | z/OS | 8.1 TS1M0 | 9.3 TS1M0 |
OpenVMS VAX | 8.1 TS1M0 | 9.3 TS1M0 |
OS/2 | 8.1 TS1M0 | |
Microsoft Windows 95/98 | 8.1 TS1M0 | |
Microsoft Windows 2000 Advanced Server | 8.1 TS1M0 | |
Microsoft Windows 2000 Datacenter Server | 8.1 TS1M0 | |
Microsoft Windows 2000 Server | 8.1 TS1M0 | |
Microsoft Windows 2000 Professional | 8.1 TS1M0 | |
Microsoft Windows NT Workstation | 8.1 TS1M0 | |
Microsoft Windows XP Professional | 8.1 TS1M0 | 9.3 TS1M0 |
Windows Millennium Edition (Me) | 8.1 TS1M0 | |
ABI+ for Intel Architecture | 8.1 TS1M0 | 9.3 TS1M0 |
AIX | 8.1 TS1M0 | 9.3 TS1M0 |
HP-UX | 8.1 TS1M0 | 9.3 TS1M0 |
IRIX | 8.1 TS1M0 | 9.3 TS1M0 |
OpenVMS Alpha | 8.1 TS1M0 | 9.3 TS1M0 |
Solaris | 8.1 TS1M0 | 9.3 TS1M0 |
Tru64 UNIX | 8.1 TS1M0 | 9.3 TS1M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
This program demonstrates that when a value has been stored in a variable and the same value is read with $VARYING informat followed by a length-variable of zero, the variable is overwritten with a blank value.
data _null_;
infile 'path';
input @11 SYSTEM $4. @;
put system= ' before ';
LEN=0;
input @11 SYSTEM $VARYING4. LEN @;
put system= 'after ';
run;
SYSTEM=DDEV before
SYSTEM= after
SYSTEM=DDEV before
SYSTEM= after
SYSTEM=DDEV before
SYSTEM= after
SYSTEM=DDEV before
SYSTEM= after
Type: | Problem Note |
Priority: | medium |
Topic: | SAS Reference ==> Informats ==> Character ==> $VARYING
|
Date Modified: | 2011-06-01 13:13:13 |
Date Created: | 2010-08-19 12:04:37 |